package com.enation.app.javashop.consumer.shop.shop;

import com.enation.app.javashop.consumer.core.event.ShopNameChangeEvent;
import com.enation.app.javashop.core.client.trade.CouponClient;
import com.enation.app.javashop.core.shop.model.vo.ShopNameChangeMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 店铺名称发生改变操作
 *
 * @author zh
 * @version v7.0
 * @date 18/12/6 下午4:10
 * @since v7.0
 */
@Service
public class ShopNameChangeConsumer implements ShopNameChangeEvent {

    @Autowired
    private CouponClient couponClient;

    @Override
    public void shopNameChange(ShopNameChangeMsg shopNameChangeMsg) {
        //当店铺名称发生改变需要修改优惠券的店铺名称
        couponClient.editCouponShopName(shopNameChangeMsg);
    }
}
